/* ====================================================
#   Copyright (C)2019 Li Jianbin All rights reserved.
#
#   Author        : Li Jianbin
#   Email         : lijianbinmail@163.com
#   File Name     : cmakewindow.h
#   Last Modified : 2019-04-21 11:00
#   Describe      : Main Window
#
# ====================================================*/

#ifndef CMAINWINDOW_H
#define CMAINWINDOW_H

#include <thread>

#include <QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QTextStream>
#include <QKeyEvent>
#include <QSplitter>
#include <QStackedWidget>
#include <QLabel>
#include <QButtonGroup>
#include <QActionGroup>


#include "src/ScenceControl.h"
#include "src/ModelControl.h"
#include <TopTools_HSequenceOfShape.hxx>
#include "c3dwidget.h"


namespace Ui {
class CMainWindow;
}


class CMainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit CMainWindow(QWidget *parent = 0);
    ~CMainWindow();


    void initUIs();     // 初始化界面方法
    void initSignals();
    void initModels();
    C3DWidget* m_3d_widget;

private slots:
    void on_actionMkCube_triggered();

    void on_actionMkCylinder_triggered();

    void on_actionMkSphere_triggered();

    void on_actionMkCone_triggered();

    void on_actionMkTorus_triggered();

    void on_actionExport_triggered();

    void on_actionReflush_triggered();

    void on_actionhideSelect_triggered();

    void on_actionstep_triggered();

    void on_actionassimp_format_triggered();

    void on_actionResize_triggered();

    void on_actionMc_triggered();

    void on_action_Path_triggered();

    void on_actionNormal_triggered();

    void on_actionMove_triggered();

    void on_actionScale_triggered();

protected slots:
    void keyPressEvent(QKeyEvent *e);


/* UI-controls */
private:
    Ui::CMainWindow *ui;
    ScenceControl *scControl;
    ModelControl *modc;     // 模型控制界面
    QSplitter *splitter;    // 主界面分割
    QStackedWidget *stack;
    QLabel *msgLabel;
    // QButtonGroup *mouseGroup;   //鼠标的组
    QActionGroup *mouseGroup;

private:
    void disPlayModel(CModel *);

private:
    CModel *machine_model;  // 变位机模型

};

#endif // CMAINWINDOW_H
